<?php
/**
 * RUBIK IT Solution & Development ltd.
 *
 * PROJECT		: Rubik Ultimate
 * @version 	: 1.1
 * COPYRIGHT	: 2008
 * ------------------------------------------------------
 * 
 * [GENERAL INFO OF THIS FILE] 
 *
 * @author			hoadn <hoadn@rubik.com.vn>
 * @access			[public/private]
 * @package		 [package name]
 *
 * Created on	:Sep 19, 2008
 */

// no direct access
defined ( '_FW_EXEC' ) or die ( 'Restricted access' );

RCoreImporter::cls('html.fieldInfo.ArrayComboboxHtmlFieldInfo');

class StaticComboboxHtmlFieldInfo extends ArrayComboboxHtmlFieldInfo {

	function setClass($cls) {
		$array = RubikHelper::getProperties($cls);
		$arr = array();
		foreach ($array as $key=>$val) {
			$arr[$val] = SysLanguage::_($key);
		}
		$this->setArray($arr);
	}
	
	/**
	 * Build the html for previewing the data
	 * NOTE: please override in case special treat
	 * 
	 * @param string $extAttributes
	 * @param int $key key value
	 * @param string $dataType DB Field data type
	 * @return string
	 */
	function buildHtmlPreviewData($extAttributes = '', $key=null, $dataType ='S') {
		return SysLanguage::_($this->_array[$this->_value]);
	}
}
?>